<?php if (count($currencies) > 1) { ?>
    <?php
    $curr_html = '';
    foreach ($currencies as $currency) {
        $curr_html .= '<form action=\'' . $action . '\' method=\'post\' enctype=\'multipart/form-data\'>';
        if ($currency['symbol_left']) {
            $curr_html .= '<input type=\'submit\' alt=\'' . $currency['title'] . '\' value=\'' . $currency['symbol_left'] . '\'' . ($currency['code'] == $currency_code ? ' disabled=\'disabled\'' : '') . ' />';
        } else {
            $curr_html .= '<input type=\'submit\' alt=\'' . $currency['title'] . '\' value=\'' . $currency['symbol_right'] . '\'' . ($currency['code'] == $currency_code ? ' disabled=\'disabled\'' : '') . ' />';
        }
        $curr_html .= '<input type=\'hidden\' name=\'currency_code\' value=\'' . $currency['code'] . '\' /><input type=\'hidden\' name=\'redirect\' value=\'' . $redirect . '\' />';
        $curr_html .= '</form>';
    }
    ?>
    <a id="open_currencies"><img src="catalog/view/theme/mobile/image/currency.png" alt="<?php echo $text_currency; ?>" /></a> 
    <script type="text/javascript">
        $(document).delegate('#open_currencies', 'click', function() {
            $(this).simpledialog({
                'mode': 'blank',
                'prompt': false,
                'forceInput': false,
                'useModal':true,
                'fullHTML':
                    "<?php echo $curr_html ?><a rel='close' data-role='button' href='#' id='simpleclose'>Close</a>"
            })
        });
    </script>
<?php } ?>
